let accountInfo = function(){
    let html = '<div style="margin: 10px;">' +
        '<fieldset class="layui-elem-field layui-field-title">\n' +
        '  <legend>个人账户</legend>\n' +
        '</fieldset>   \n' +
        ' \n' +
        '<div style="padding: 20px; background-color: #F2F2F2;">\n' +
        '  <div class="layui-row layui-col-space15">\n' +
        '    <div class="layui-col-md6">\n' +
        '      <div class="layui-card">\n' +
        '        <div class="layui-card-header">账户信息</div>\n' +
        '        <div class="layui-card-body">\n' +
        '账户：<span id="account">admin</span><br>'+
        '名称：<span id="userName">阿德民</span>'+
        '        </div>\n' +
        '      </div>\n' +
        '    </div>\n' +
        '    <div class="layui-col-md6">\n' +
        '      <div class="layui-card">\n' +
        '        <div class="layui-card-header">代理等级</div>\n' +
        '        <div class="layui-card-body">\n' +
        '等级名称：<span id="level_name">黄金Ⅲ</span><br>'+
        '上级代理：<span id="parent">1</span>'+
        '        </div>\n' +
        '      </div>\n' +
        '    </div>\n' +
        '    <div class="layui-col-md12">\n' +
        '      <div class="layui-card">\n' +
        '        <div class="layui-card-header">资金明细</div>\n' +
        '        <div class="layui-card-body">\n' +
        '可提现金额：<span id="money">95555.56</span><br><button type="button" class="layui-btn layui-btn-danger">立即提现</button><br>'+
        '        </div>\n' +
        '      </div>\n' +
        '    </div>\n' +
        '  </div>\n' +
        '</div> ' +
        '</div>';

    layui.use(['table', 'form', 'jquery', 'element'], function () {
        var table = layui.table
            , form = layui.form
            , $ = layui.jquery
            , element = layui.element;

        $("#mainbody").html(html);
        let level_id;
        //加载用户信息
        $.ajax({
            type: "GET",
            url: "admin",
            dataType: "json",
            async:false,
            contentType: "application/json",
            success: function (list) {
                if(list.id!=null){
                    $("#account").html(list.username);
                    $("#userName").html(list.name);
                    $("#parent").html(list.parent);
                    $("#money").html(list.money);
                    level_id = list.levelId;
                }

            },
            error: function () {
                console.log("获取用户信息错误！");
            }
        });

        //加载用户等级
        $.ajax({
            type: "GET",
            url: "dealersLevel/getById?id="+level_id,
            dataType: "json",
            async:false,
            contentType: "application/json",
            success: function (list) {
                if(list.id!=null){
                    $("#level_name").html(list.name);
                }

            },
            error: function () {
                console.log("获取用户等级错误！");
            }
        });






    })
}
